package com.fwindcore.res;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;

public class ImageFactory implements IResource{

	
	private static final Image titleImg = new Image(ATLAS.findRegion("title"));
	private static final Image stoneImg = new Image(ATLAS.findRegion("stone"));
	
	private static final Image mainBgImg = new Image(ATLAS.findRegion("bg"));
	
	private static final Image buttonImg = new Image(ATLAS.findRegion("button"));
	private static final Image layerImg = new Image(ATLAS.findRegion("layer"));
	
	private static final Image blackImg = new Image(ATLAS.findRegion("black"));
	private static final Image whiteImg = new Image(ATLAS.findRegion("white"));
	private static final AtlasRegion transAtlas = ATLAS.findRegion("trans");
	
	private static final Image buttonStartImg = new Image(ATLAS.findRegion("buttonStart"));
	private static final Image rabbitImg = new Image(ATLAS.findRegion("bunny"));
	
	public static Image getImage(String name){
		TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("pic/pack"));
		return new Image(atlas.findRegion(name));
	}
	
	public static Image getLoadBGImg(){
		return blackImg;
	}
	public static Image getGameBGImg(){
		return mainBgImg;
	}
	public static Image getTitleImg(){
		return titleImg;
	}
	
	public static Image getButtonStartImg(){
		return buttonStartImg;
	}
	
	public static Image getGameOverImg(){
		return layerImg;
	}
	
	public static AtlasRegion getRabbitRegion(){
		return ATLAS.findRegion("bunny");
	}

	public static Drawable getStoneDrawble(){
		return stoneImg.getDrawable();
	}
	
	public static TextureRegion getTransTextureRegion(){
		return transAtlas;
	}
	
	
}
